# -*- coding: utf-8 -*-
#
# File: banner_materias.py
#
# Copyright (c) 2007 by LM
# Generator: ArchGenXML Version 1.5.1 svn/devel
#            http://plone.org/products/archgenxml
#
# GNU General Public License (GPL)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#

__author__ = """LM <leonardo.mirandas@gmail.com>"""
__docformat__ = 'plaintext'

from AccessControl import ClassSecurityInfo
from Products.Archetypes.atapi import *
from Products.Archetypes.SQLStorage import *
from Products.GrupoVisao.config import *

##code-section module-header #fill in your manual code here
##/code-section module-header

schema = Schema((

    ImageField(
        name='foto',
        widget=ImageWidget(
            label="Banner",
            description="Efetue Upoad do banner. O banner deverá ter o tamanho de 150px de largura por no maximo 60px de altura",
            label_msgid='GrupoVisao_label_foto',
            description_msgid='GrupoVisao_help_foto',
            i18n_domain='GrupoVisao',
        ),
        required=1,
        storage=AttributeStorage()
    ),


    TextField(
        name='metatag',
        widget=TextAreaWidget(
            label="Tag do YouTuBe",
            description="Informe a tag 'Incorporar' do site do youtube.",
            label_msgid='GrupoVisao_label_metatag',
            description_msgid='GrupoVisao_help_metatag',
            i18n_domain='GrupoVisao',
        ),
        required=1
    ),

    TextField('description',
        widget=TextAreaWidget(
            label="Observações",
            description="Informe uma breve descrição sobre o vídeo.",
            label_msgid='GrupoVisao_label_description',
            description_msgid='GrupoVisao_help_description',
            i18n_domain='GrupoVisao',
        ),
        required=1,
        accessor="Description",
        searchable=1,
    ),

),
)

##code-section after-local-schema #fill in your manual code here
##/code-section after-local-schema

banner_schema = BaseSchema.copy() + \
    schema.copy()

##code-section after-schema #fill in your manual code here
##/code-section after-schema

class banner(BaseContent):
    """
    """
    security = ClassSecurityInfo()
    __implements__ = (getattr(BaseContent,'__implements__',()),)

    # This name appears in the 'add' box
    archetype_name = 'Banner Matérias'

    meta_type = 'banner_materia'
    portal_type = 'banner_materia'
    allowed_content_types = []
    filter_content_types = 0
    global_allow = 1
    #content_icon = 'banner.gif'
    immediate_view = 'base_view'
    default_view = 'base_view'
    suppl_views = ()
    typeDescription = "Banners de matérias da mídia"
    typeDescMsgId = 'description_edit_banner'
    allow_discussion = 0

    actions =  (
       {'action': "string:${object_url}/banner_view",
        'category': "object",
        'id': 'view',
        'name': 'View',
        'permissions': ("View",),
        'condition': 'python:1'
       }, 

    )

    _at_rename_after_creation = True

    schema = banner_schema

    ##code-section class-header #fill in your manual code here
    ##/code-section class-header

    # Methods

registerType(banner, PROJECTNAME)
# end of class banner

##code-section module-footer #fill in your manual code here
##/code-section module-footer



